
// 24小时天气, ℃:\u2103, °:\xB0
(function(){
    var rp0, $hours_c,
        tempList, iconList, tempNameList, hstart,
        vItems, hItems;

    $hours_c = $('#wea_hour');
    hstart = $hours_c.data('hstart');
    tempList = $hours_c.data('temp').split(',');
    //time
    hItems = _getHItem(hstart);
    _renderHItems(hItems);
    function _getHItem (hStart) {
        hItems = [];
        for(var i = 0; i < 24; i ++){
            if(hStart + i == 24){
                hStart = -i;
            }
            hItems.push(hStart + i);
        }
        return hItems;
    }
    function _renderHItems (hItems) {
        $('.hd').each(function (i) {
            $(this).html(hItems[i] + '点');
        });
    }
    // 温度
    $('.ft').each(function (i) {
            $(this).html(tempList[i]);
        });

    // 天气状况
    tempNameList = $hours_c.data('tempname').split(',');
     $('.f_wz').each(function (i) {
            $(this).html(tempNameList[i]);
        });
     for (i = 0; i < 24; i++){
        //"<li" + (wea_h_hour[i]["hour"] == a ? ' class="current"': "") + '><div class="hd">' + wea_h_hour[i]["hour"] + '点</div><div class="bd"><p class="f_ico"><span class="wea_l ' + wea_h_hour[i]["icon"] + "_lbx " + b + '"></span></p><p class="f_wz">' + wea_h_hour[i]["tq"] + '</p></div><div class="ft">' + wea_h_hour[i]["temp"] + "℃</div></li>"
        html = "<li" + '><div class="ft">' + tempList[i] + "℃</div></li>"
        //  html += "<li" + (hItems[i] == a ? ' class="current"': "") + '><div class="hd">' + hItems[i] + '点</div><div class="bd"><p class="f_ico"></p><p class="f_wz">' + tempList[i] + '</p></div><div class="ft">' + tempNameList[i] + "℃</div></li>"
     
     }
    
     $("#wea_hour ul").html(html);
})();

